#ifndef LUTMODEL_H
#define LUTMODEL_H

#include <set>
#include <iostream>
#include "liblut/core/LutBound.h"
#include "liblut/core/Interpolator.h"

using namespace std;
class LutModel
{
public:
    typedef std::set<LutBound>::iterator iterator;
    typedef std::set<LutBound>::const_iterator const_iterator;
    typedef std::set<LutBound>::reverse_iterator riterator;
    typedef BoundInterpolator::InterpolatorType InterpolatorType;
    LutModel(eLutColorSpace colorspace);
    //
    bool addBound(double val, int channel1, int channel2, int channel3);
    void removeBound(int index);
    void removeBound(double val);
    void clear();
    //
    eLutColorSpace getColorSpace()
        {return m_colorSpace ;}
    void setInterpolatorType(InterpolatorType interpolationType);
    InterpolatorType getInterpolatorType() const;
    BoundInterpolator getInterpolator() const;

    iterator begin() {
        iterator ite_begin= m_lutBounds.begin();
        return ite_begin;
     }

    iterator end() {
        iterator ite_end= m_lutBounds.end();
        return ite_end;
     }

    riterator rbegin() {
        riterator ite_begin= m_lutBounds.rbegin();
        return ite_begin;
     }

    riterator rend() {
        riterator ite_end= m_lutBounds.rend();
        return ite_end;
     }

    friend ostream& operator<< (ostream &out, LutModel &LutModel);

private:
    eLutColorSpace m_colorSpace;
    set<LutBound> m_lutBounds;
    InterpolatorType m_interpolationType;
    BoundInterpolator m_interpolator;
};

#endif // LUTMODEL_H
